PATH Index > Creating a metapackage
Creating a metapackage

This document shows how to create a metapackage containing two packages: one to install the Font Book application in the /Applications folder, another one to install fonts in the /Library/Fonts folder. This will let you discover the Settings, Files and Components panes.

Note: The Font Book application is available on Mac OS X 10.3 and later. If you are running an older version of Mac OS X, use the TextEdit application instead.

Creating a new project

1Open the Iceberg application.
2Choose File > New Project… .
3Select the Core Templates Metapackage project template and click Next.
4Type MyMetapackage in the Project name text field and click Finish.

Creating packages

Managing complex hierarchies of packages and metapackages does not require multiple projects, one is enough.

Start by creating the first package which will be a required component of the installation and will install the Font Book application:

1Choose View > Components.
2Choose Project > New Component… .
3Type Font Book in the Component name text field.
3Choose Required from the Attribute pop-up menu and click Add.
4Select the new package in the Packages & Metapackages list.
5Choose View > Files.
6Click on the disclosure triangle of the / folder to reveal its content.
7Select the Applications line.
8Choose Archive > Add Files… .
9Go the Applications folder.
10Select the Font Book application and click Add.
11Choose the reference style from the Reference Style pop-up menu.

Note: The default reference style can be changed in the Preferences dialog.

12Click Add.

Then, create the second package which will be installed by default but can be unselected with the Custom Install mode:

1Choose View > Project.
2Choose View > Files.
3Choose Project > New Component… .
4Type Additional Fonts in the Component name text field.
5Choose Selected from the Attribute pop-up menu and click Add.
6Select the new package in the Packages & Metapackages list.
7Choose View > Files.
8Click on the disclosure triangle of the / folder to reveal its content.
9Select the Library line.
10Choose Archive > New Folder.
11Type Fonts in the text field.
12Choose Archive > Add Files… .
13Go to the /Library/Fonts folder.
14Select one or more fonts and click Add.
15Choose the reference style from the Reference Style pop-up menu.

Note: The default reference style can be changed in the Preferences dialog.

16Click Add.

Tweaking packages settings

Installing items in the /Applications and /Library/Fonts folders requires administrative privileges. You are going to tweak the packages settings so that the user needs to authenticate when he/she installs the metapackage.

1Select the Font Book package in the Packages & Metapackages list.
2Choose View > Settings.
3Choose Root Authorization from the Authorization pop-up menu.
4Select the Additional Fonts package in the Packages & Metapackages list.
5Choose View > Settings.
6Choose Root Authorization from the Authorization pop-up menu.

Adding a welcome message

You are now going to add a Welcome message which will be displayed by Installer when you launch the installation procedure of the metapackage.

1Choose View > Project.
2Choose View > Components.
3

With a text editor, create a text document and write a welcome message. Save this document in the metapackage project folder.

Note: The text document format can be text, RTF, RTFd or HTML.
4Click the Path radio button of the Welcome section.
5Choose Choose… from the Action pop-up menu of the Welcome section.
6Go to the metapackage project.
7Select the text document and click Choose.

Building the metapackage

1Choose File > Save.
2Choose Project > Build.

The MyMetapackage.mpkg will be created the build folder at the same level that the project document. Two packages named Font Book.pkg and Additional Fonts.pkg are created at the same level.


Author: Stéphane Sudre